From: Keir Fraser Date: Wed, 26 May 2010 07:15:31 +0000 (+0100) Subject: tools: Fix time offset when localtime=0 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12083 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=221bac1943483d40500379d3b049552fd4314e66;p=xen.git tools: Fix time offset when localtime=0 localtime can be stored in vm config as a string, resulting in incorrect calculation of rtc_timeoffset. Cast localtime to int to ensure rtc_timeoffset is calculated properly. Signed-off-by: Jim Fehlig --- diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index cb5f6350e6..144f4f846a 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -129,7 +129,7 @@ class ImageHandler: self.dmargs = self.parseDeviceModelArgs(vmConfig) self.pid = None rtc_timeoffset = int(vmConfig['platform'].get('rtc_timeoffset', 0)) - if vmConfig['platform'].get('localtime', 0): + if int(vmConfig['platform'].get('localtime', 0)): if time.localtime(time.time())[8]: rtc_timeoffset -= time.altzone else: